package com.campusbackend.controller;

import com.campusbackend.entity.Result;
import com.campusbackend.entity.MemberRoles;
import com.campusbackend.service.MemberRolesService;
import com.campusbackend.utils.ResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 队员身份字典表 前端控制器
 * </p>
 *
 * @author yezi
 * @since 2025-07-26
 */
@Slf4j
@RestController
@RequestMapping("/member-roles")
public class MemberRolesController {

    @Autowired
    private MemberRolesService memberRolesService;

    /**
     * 获取所有可用的队员角色
     * @return 角色列表
     */
    @GetMapping("/list")
    public Result<List<MemberRoles>> getAllRoles() {
        log.info("获取队员角色列表请求");
        
        List<MemberRoles> roles = memberRolesService.getAllActiveRoles();
        
        return ResultUtil.success(roles);
    }
} 